export async function getGptReply(params) {
  return await fetch('/api1/v1/chat/completions', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      Authorization:
        'Bearer sk-proj-rKDly9KpY3Q2dXR0dGo7T3BlbkFJAxJ8M7c5hoFYibW1N0hf',
    },
    body: JSON.stringify({
      model: 'gpt-4o',
      messages: params,
      stream: true
    })
  });
}

export async function audioSpeech(params = 'Today is a wonderful day to build something people love!') {
  return await fetch('/api1/v1/audio/speech', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      Authorization:
        'Bearer sk-proj-rKDly9KpY3Q2dXR0dGo7T3BlbkFJAxJ8M7c5hoFYibW1N0hf',
    },
    body: JSON.stringify({
      model: 'tts-1',
      input: params,
      voice: 'onyx'
    })
  });
}

